#ifndef _SIMPLE_FACTORY_H_
#define _SIMPLE_FACTORY_H_


#include <iostream>

using namespace std;

class IOperation
{
public:
	virtual int GetResult(int num1,int num2) = 0;
	//virtual ~IOperation();
};

class OperationAdd : public IOperation
{
public:
	virtual int GetResult(int num1,int num2){
		return (num1 + num2);
	}
};

class OperationSub:public IOperation
{
public:
	virtual int GetResult(int num1,int num2){
		return (num1 - num2);
	}
};

class OperationMul:public IOperation
{
public:
	virtual int GetResult(int num1,int num2){
		return (num1 * num2);
	}
};

class OperationFactory
{
public:
	typedef enum 
	{
		OPERA_ADD = 0,
		OPERA_SUB,
		OPERA_MUL
	}OPERATION;
	
	static IOperation *CreateOperation(OPERATION oper);
};
#endif
